﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using MyFirstHelloWorld.Models;

namespace MyFirstHelloWorld.Controllers
{
    public class CustomerController : Controller
    {
        //
        // GET: /Customer/

        public ActionResult Index()
        {
            return View();
        }

        [HttpPost]
        public ViewResult DisplayCustomer()
        {
            Customer objCustomer = new Customer();
            objCustomer.Id = Convert.ToInt16(Request.Form["Id"].ToString());
            objCustomer.Code = Request.Form["Code"].ToString();
            objCustomer.Name = Request.Form["Name"].ToString();
            objCustomer.Amount = Convert.ToDouble(Request.Form["Amount"].ToString()); ;
            return View("Customer/DisplayCustomer", objCustomer);
        }
    }
}
